﻿Namespace Attributes
    <System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple:=False, Inherited:=True), System.Serializable()> _
    Public Class SelfMappClassAttribute
        Inherits Attribute
        Implements IClassAttribute

        Private _isView As Boolean
        Public Property isView() As Boolean
            Get
                Return _isView OrElse Not String.IsNullOrEmpty(ViewStatement)
            End Get
            Set(ByVal value As Boolean)
                If value Then
                    Me.IsNotAddEntity = True
                    Me.IsNotUpdateableEntity = True
                    Me.isNotQueryEntity = True
                End If
                _isView = value
            End Set

        End Property


        Public _viewString As String
        Public Property ViewStatement() As String
            Get
                Return _viewString
            End Get
            Set(ByVal value As String)
                _viewString = value
                isView = Not String.IsNullOrEmpty(value) AndAlso Not String.IsNullOrEmpty(value.Trim())
            End Set
        End Property


        Private _DataBaseName As String = "cnnString"
        Public Property DataBaseName As String

            Get
                Return _DataBaseName
            End Get
            Set(ByVal value As String)
                _DataBaseName = value
            End Set
        End Property

        Private _TableName As String
        Public Property TableName() As String
            Get
                Return _TableName
            End Get
            Set(ByVal value As String)
                _TableName = value
            End Set
        End Property

        Private _BussinesLogicName As String
        Public Property BussinesLogicClassName() As String
            Get
                Return _BussinesLogicName
            End Get
            Set(ByVal value As String)
                _BussinesLogicName = value
            End Set
        End Property

        Private _IsNotUpdateableEntity As Boolean
        Public Property IsNotUpdateableEntity() As Boolean
            Get
                Return _IsNotUpdateableEntity
            End Get
            Set(ByVal value As Boolean)
                _IsNotUpdateableEntity = value
            End Set
        End Property

        Private _isNotAddEntity As Boolean
        Public Property IsNotAddEntity() As Boolean
            Get
                Return _isNotAddEntity
            End Get
            Set(ByVal value As Boolean)
                _isNotAddEntity = value
            End Set
        End Property

        Private _isNotQueryEntity As Boolean
        Public Property isNotQueryEntity() As Boolean
            Get
                Return _isNotQueryEntity
            End Get
            Set(ByVal value As Boolean)
                _isNotQueryEntity = value
            End Set
        End Property

        Private _Description As String
        Public Property Description() As String
            Get
                Return _Description
            End Get
            Set(ByVal value As String)
                _Description = value
            End Set
        End Property



    End Class

    
End Namespace